//
//  DYManageCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/14.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYManageCell.h"

@interface DYManageCell ()

@property (nonatomic,strong)UIImageView *iconImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *contentLabel;
@property (nonatomic,strong)UIImageView *arrow;

@end

@implementation DYManageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.sideMargin=BILIWIDTH(10);
    
    self.iconImageView = ({
        UIImageView *imageView=[Utils imageView];
        imageView;
    });
    
    self.titleLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:15 textColor:[UIColor xhq_content] alignment:0];
        label;
    });
    
    self.contentLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:0];
        label;
    });
    
    self.arrow = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"arrow_right")];
        imageView;
    });
    
    
    [self addSubview:self.iconImageView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.contentLabel];
    [self addSubview:self.arrow];
    
    [self.iconImageView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(13));
        make.centerY.equalTo(self);
        make.width.equalTo(BILIWIDTH(34));
    }];
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconImageView.right).offset(BILIWIDTH(12));
        make.top.equalTo(self.iconImageView);
    }];
    
    [self.contentLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.top.equalTo(self.titleLabel.bottom).offset(BILIHEIGHT(5));
    }];
    
    [self.arrow makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-10));
        make.centerY.equalTo(self);
    }];

}
-(void)getDic:(NSDictionary *)dic
{
    self.iconImageView.image=[UIImage imageNamed:dic[@"image"]];
    self.titleLabel.text=dic[@"title"];
    self.contentLabel.text=dic[@"content"];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
